/**
 * 关于规则接口
 */
import request from '@/utils/request'

const api_name = '/monitor/rules'
export default {
  //根据规则集合的id查询全部规则
  allRelus(collectionId) {
    return request({
      url: `${api_name}/queryAllRules/${collectionId}`,
      method: 'get'
    })
  },
  //添加或者更新一条规则
  addMonitorRule(data) {
    return request({
      url: `${api_name}/saveOrUpdateOneRule`,
      method: 'post',
      data: data
    })
  },
  //根据id删除一条规则
  deleteOneRule(ruleId) {
    return request({
      url: `${api_name}/deleteOneRule/${ruleId}`,
      method: 'delete'
    })
  },
  //查询一条规则
  getOneRule(ruleId) {
    return request({
      url: `${api_name}/getOneRule/${ruleId}`,
      method: 'get'
    })
  },
}
